import java.util.Scanner;

public class firstweek_demo4 {
    public static void main(String[] args) {
        int a[]={10,20,30,40,50};
        System.out.println("a数组{10,20,30,40,50}的长度为"+a.length);//输出定义好的数组长度
        System.out.println("请输入C数组的内容并用逗号隔开：");
        Scanner c = new Scanner(System.in);
        String input = c.next().toString();//输入自定义的数组
        String b[] = input.split(",");//去除“，”
        int C[] = new int[b.length];
        for(int i = 0; i<b.length;i++) {
            C[i] = Integer.parseInt(b[i]);//将去逗号的内容以整数的形式赋值
            System.out.println(b[i]+" ");//输出整数
        }
        System.out.println("C数组的长度为："+C.length);//输出数组长度
    }
}
